using System;
using System.Collections.Generic;
using System.Text;

namespace Rensselaer_Event_Finder.Hibernate.DAO
{
    
     /// The service that facilitates interaction between the database
     /// and the application for the EventComment class
     
    public class EventCommentDAO : GenericNHibernateDAO<EventComment, int>
    {
        /// <summary>
        ///  Make the entity persistent. It will be inserted or updated in the database 
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>

        new public EventComment save(EventComment entity)
        {
            Globals.getWebService().saveEventComment(entity.User.Id, entity.MyEvent.Id, Globals.sanitizeSQL(entity.Text));
            Globals.syncDatabase();
            return entity;
        }
    }
}
